<!-- 
    @author Wójcik Karol <wojcikk@student.agh.edu.pl>
    @licence http://www.gnu.org/copyleft/gpl.html GNU/GPL
-->

<table border='0' width=95% > 
<tr>
    <th>Imi&#281;</th>
    <th>Nazwisko</th>
    <th>Tytu&#322;</th>
    <th>Stanowisko</th>
    <th>Login</th>
    <th>E-mail</th>
    <th>Rola</th>
 </tr>

<% for user in @users %>
<% if user.role!="admin"%>
  <tr>
    <td><%=h user.name %></td>
    <td><%=h user.surname %></td>
    <td><%=h user.mark.name %></td>
    <td><%=h user.position.name %></td>
    <td><%=h user.login %></td>
    <td><%=h user.email %></td>
    <td><%=h user.role %></td>
    <td><% if @session['user'].role == "admin" %>
	    <%= link_to 'Zmie&#324;', :action => 'edit', :id => user %>
	<% else %>
	    <%= link_to 'Zmie&#324;', :action => 'edit_user', :id => user %>
	<% end %>
    </td>
    <td><% if @session['user'].role == "admin" %> 
	    <%= link_to 'Usu&#324;', { :action => 'delete', :id => user  }, :confirm => 'Are you sure?', :post => true%> 
	<%  end %>
    </td>
  </tr>
  <% end %>
  <% end %>
</table>
